<!--
 * @Author: 肖世渊 xiao2655308229@163.com
 * @Date: 2025-09-24 16:15:55
 * @LastEditors: 肖世渊 xiao2655308229@163.com
 * @LastEditTime: 2025-09-25 15:07:03
 * @FilePath: \team-work\am-ui\src\pages\am\monitor\Video.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>检测视频
    <el-row>
      <el-col :span="4">
        <div class="tree">
          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
          </el-input>
          <el-tree class="filter-tree" :data="EngData" :props="defaultProps" :filter-node-method="filterNode">
          </el-tree>
        </div>
      </el-col>
      <el-col :span="20">
        <div class="table"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { get } from '@/utils/request';
export default {
  data() {
    return {
      filterText: '',
      defaultProps: {
        children: 'children',
        label: 'name'
      },
      // 树形结构展示数据 
      EngData: [],
    };

  },
  computed: {},
  methods: {
    async getEngDevData() {
      let res = await get('/engineer/findEngineerDeviceTree');
      // console.log(res, '88888');
      this.EngData = res.data;
    },
    filterNode(value, data) {
      // data是树形结构数据 
      if (!value) return true;
      // value输入框输入的值 
      // 返回就是包含输入框关键字的label(节点)  
      return data.name.indexOf(value) !== -1;
    },
  },
  created() {
    this.getEngDevData();
  },
  mounted() { },
};
</script>
<style scoped>
.tree {
  height: calc(100vh - 60px);
  padding-right: 10px;
  border-right: 1px solid #ececec;
  margin-right: 10px;
  position: relative;
}

</style>